﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace Big_Data
{
    public partial class ChaTime : Form
    {
        DataBase dataBase = new DataBase();
        public ChaTime()
        {
            InitializeComponent();
        }

      

        private void Chart_Load(object sender, EventArgs e)
        {
            string sqlstr = "select * from View_Time";
            DataTable dataTable = dataBase.show(sqlstr);
            Series dataTableSeries = new Series("dataTable");
            dataTableSeries.Points.DataBind(dataTable.AsEnumerable(), "Ass_date", "Rec_date", "");
            dataTableSeries.YValueType = ChartValueType.DateTime;//设置Y轴类型为时间
            //dataTableSeries.ChartType = SeriesChartType.Column;  //设置Y轴为柱形图
            chart1.Series.Add(dataTableSeries);//加入你的chart1
        }
    }
}
